package com.aspose.cells;

class zaap extends zyu {
   public zaap(byte[] var1, int var2) {
      super(var1, var2, 14);
   }

   public boolean g() {
      return true;
   }

   public int d() {
      return 32;
   }

   public zagu e(zaay var1) {
      return this.d(var1).e(var1);
   }

   public zagu d(zaay var1) {
      if (this.a != null) {
         if (this.a.a == null) {
            this.a.a = this.l(var1);
         }

         return this.a.a;
      } else {
         return this.l(var1);
      }
   }

   private zagu l(zaay var1) {
      WorksheetCollection var2 = var1.p.g;
      int var3 = com.aspose.cells.b.a.zc.e(this.b, this.c + 2) & '\uffff';
      int var4 = var2.q().c(var3);
      int var5 = var2.q().d(var3);
      if (var4 != var2.u()) {
         return zzf.a;
      } else if (var5 >= 0 && var5 <= var2.getCount()) {
         int var6 = com.aspose.cells.b.a.zc.e(this.b, this.c + 4);
         int var7 = com.aspose.cells.b.a.zc.a(this.b, this.c + 6);
         ListObject var8 = var2.get(var5).getListObjects().a(var7);
         if (var8 != null && (this.b[this.c + 5] & 255 & 48) == 0) {
            int var9 = com.aspose.cells.b.a.zc.e(this.b, this.c + 10) & '\uffff';
            int var10 = com.aspose.cells.b.a.zc.e(this.b, this.c + 12) & '\uffff';
            if (var9 >= var8.getListColumns().getCount()) {
               return zzf.a;
            } else {
               var9 += var8.getStartColumn();
               var10 += var8.getStartColumn();
               int var11 = var8.getStartRow();
               int var12 = var8.getEndRow();
               int var13 = var6 & '\uffff' & 3;
               boolean var14 = false;
               switch((var6 & '\uffff') >> 2 & 31) {
               case 1:
                  if (var13 == 0) {
                     var9 = var8.getStartColumn();
                     var10 = var8.getEndColumn();
                  }
                  break;
               case 2:
                  var11 = var8.getStartRow();
                  var12 = var11;
                  if (var13 == 0) {
                     var9 = var8.getStartColumn();
                     var10 = var8.getEndColumn();
                  }
                  break;
               case 8:
                  if (!var8.j()) {
                     return zzf.a;
                  }

                  var11 = var8.getEndRow();
                  var12 = var11;
                  break;
               case 16:
                  var14 = true;
                  var11 = var1.g;
                  var12 = var11;
                  break;
               default:
                  if (var8.getShowHeaderRow()) {
                     ++var11;
                  }

                  if (var8.getShowTotals()) {
                     --var12;
                  }

                  if (var13 == 0) {
                     var9 = var8.getStartColumn();
                     var10 = var8.getEndColumn();
                  }
               }

               zaye var15 = new zaye(var2.q().b(var3), var11, var9, var12, var10);
               if (var14) {
                  var15.a(false);
                  var15.c(false);
               }

               return new zaal(32, var15);
            }
         } else {
            return zzf.a;
         }
      } else {
         return zzf.a;
      }
   }

   public int b(zaay var1, boolean var2) {
      this.a(false);
      return this.d(var1).b(var1, var2);
   }

   public boolean a(zaay var1, int var2, int var3, boolean var4) {
      this.a(false);
      return this.d(var1).a(var1, var2, var3, var4);
   }

   public boolean f(zaay var1) {
      this.a(false);
      return this.d(var1).f(var1);
   }

   public boolean g(zaay var1) {
      this.a(false);
      return this.d(var1).g(var1);
   }

   public boolean h(zaay var1) {
      this.a(false);
      return this.d(var1).h(var1);
   }

   public zagu a(int[] var1, zaay var2, boolean var3) {
      this.a(false);
      return this.d(var2).a(var1, var2, var3);
   }

   public zagu a(int[] var1, zaay var2) {
      this.a(false);
      return this.d(var2).a(var1, var2);
   }

   public zagu b(int[] var1, zaay var2) {
      this.a(false);
      return this.d(var2).b(var1, var2);
   }

   public zahn a(zaay var1, boolean var2) {
      this.a(false);
      return this.d(var1).a(var1, var2);
   }

   public void a(StringBuilder var1, zaay var2) {
      if (var2 == null) {
         var1.append("[TABLE-NEED-CONTEXT-TO-BUILD-STRING-EXPRESSION]");
      } else {
         WorksheetCollection var3 = var2.p.g;
         int var4 = com.aspose.cells.b.a.zc.e(this.b, this.c + 2) & '\uffff';
         int var5 = var3.q().c(var4);
         int var6 = var3.q().d(var4);
         if (var5 != var3.u()) {
            var1.append("#REF!");
         } else if (var6 >= 0 && var6 <= var3.getCount()) {
            int var7 = com.aspose.cells.b.a.zc.e(this.b, this.c + 4);
            int var8 = com.aspose.cells.b.a.zc.a(this.b, this.c + 6);
            ListObject var9 = var3.get(var6).getListObjects().a(var8);
            if (var9 != null && (this.b[this.c + 5] & 255 & 48) == 0) {
               int var10 = com.aspose.cells.b.a.zc.e(this.b, this.c + 10) & '\uffff';
               int var11 = com.aspose.cells.b.a.zc.e(this.b, this.c + 12) & '\uffff';
               if (var10 >= var9.getListColumns().getCount()) {
                  var1.append("#REF!");
               }

               if (var11 >= var9.getListColumns().getCount()) {
                  var11 = var10;
               }

               int var12 = var7 & '\uffff' & 3;
               switch((var7 & '\uffff') >> 2 & 31) {
               case 8:
                  var1.append(var9.getDisplayName());
                  var1.append('[');
                  var1.append('[');
                  var1.append("#Totals");
                  var1.append("],[");
                  var1.append(zaan.c(var9.getListColumns().get(var10).getName()));
                  var1.append("]");
                  if (var11 != var10) {
                     var1.append(":[");
                     var1.append(zaan.c(var9.getListColumns().get(var11).getName()));
                     var1.append("]");
                  }

                  var1.append("]");
                  return;
               case 16:
                  var1.append(var9.getDisplayName());
                  var1.append('[');
                  var1.append('[');
                  var1.append("#This Row");
                  var1.append("],[");
                  var1.append(zaan.c(var9.getListColumns().get(var10).getName()));
                  var1.append("]");
                  if (var11 != var10) {
                     var1.append(":[");
                     var1.append(zaan.c(var9.getListColumns().get(var11).getName()));
                     var1.append("]");
                  }

                  var1.append("]");
                  return;
               default:
                  if (var12 == 0) {
                     var1.append(var9.getDisplayName());
                     var1.append("[]");
                  } else {
                     boolean var13 = var2.n == var6;
                     if (!var13 || var2.g < var9.getStartRow() || var2.g > var9.getEndRow() || var2.h < var9.getStartColumn() || var2.h > var9.getEndColumn()) {
                        var1.append(var9.getDisplayName());
                     }

                     var1.append('[');
                     if (var10 == var11) {
                        var1.append(zaan.c(var9.getListColumns().get(var10).getName()));
                     } else {
                        var1.append('[');
                        var1.append(zaan.c(var9.getListColumns().get(var10).getName()));
                        var1.append("]:[");
                        var1.append(zaan.c(var9.getListColumns().get(var11).getName()));
                        var1.append(']');
                     }

                     var1.append(']');
                  }
               }
            } else {
               var1.append("#REF!");
            }
         } else {
            var1.append("#REF!");
         }
      }
   }
}
